import win32gui
import win32con

class WindowController :
	@staticmethod
	def getProcessByTitle(title ):
		hwnd = win32gui.FindWindowEx(0,0,0, title)
		return hwnd
	
	@staticmethod
	def showXBMC():
		hwnd = WindowController.getProcessByTitle("XBMC Media Center")
		win32gui.ShowWindow(hwnd,win32con.SW_SHOWDEFAULT)
		win32gui.SetForegroundWindow(hwnd)
	
	@staticmethod
	def hiddenXBMC():
		hwnd = WindowController.getProcessByTitle("XBMC Media Center")
		win32gui.ShowWindow(hwnd,win32con.SW_HIDE)
		

if __name__ == '__main__' :
	import time
	WindowController.hiddenXBMC()
	WindowController.showXBMC()